  <template>
      <div class="banner swiper-container" ref="swiperbar">
        <ul class="clearfix swiper-wrapper">
          <li v-for="(item,index) in sliderlist" :key="item.id" class="swiper-slide">
            <a :href="item.link">
              <img :src="item.img" alt=""/>
              <div class="text-box">
                <h2>{{item.title}}</h2>
                <p>{{item.createTime}}</p>
              </div>
            </a>
          </li>
        </ul>

      </div>

  </template>
  <script>
    //import '../assets/js/jquery-1.7.2';
    import untils from '../assets/untils/untils';
    import API from '../api/api'
    export default{
        data(){
            return{
                sliderlist:[]
            }
        },
      mounted(){
        let url='/clients/huoban-sales/http/sales/function/banner/findList.do';
        let data={
          currentPage:1
        };
        var _this=this;


        let params={
          data:data,
          url:url,
          method:'POST',
          showLoading:false,
        };

        untils.loadAsycJs('SWIPER','/static/swipe.js',()=>{
          API.request(params).then((res)=>{
            this.sliderlist=res.data.list;
          }).then(()=>{
            var mySwiper = new Swiper(_this.$refs.swiperbar, {
              autoplay: true,  //可选选项，自动滑动
            });

          })
        })


      }
    }
  </script>
